package com.sias.regexp;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author 吴文杰
 * @version 1.0
 * @createTime 2023-05-03 13:45:55
 */
public class RegExp03 {
  public static void main(String[] args) {
    String content = "1111111";
    String regStr = "(\\d)\\1{5}";
    Pattern compile = Pattern.compile(regStr);
    Matcher matcher = compile.matcher(content);
    while (matcher.find()) {
      System.out.println("找到：" + matcher.group(0));
    }
    content = "12321-333999111";
    // regStr = "\\d{5}\\-(\\d)\\1{2}(\\d)\\2{2}(\\d)\\3{2}";
    regStr = "\\d{5}-((\\d)\\2{2}){3}";
    compile = Pattern.compile(regStr);
    matcher = compile.matcher(content);
    while (matcher.find()) {
      System.out.println("找到：" + matcher.group(0));
    }
  }
}
